import { createRouter, createWebHistory } from 'vue-router';
import Login from '../components/Login.vue'
import DataBoard from '../components/DataBoard.vue'
import AnnounceH from "../components/AnnounceH.vue";
import Main from '../components/Main.vue'
import Announce from "../components/Announce.vue";
import Appeal from "../components/Appeal.vue";
import ProductM from "../components/ProductM.vue";
import ApprovalProduct from "../components/ApprovalProduct.vue";
import UnApproval from "../components/UnApproval.vue";
import ApprovalShare from "../components/ApprovalShare.vue";
import UnApprovalShare from "../components/UnApprovalShare.vue";
import ApprovalComment from "../components/ApprovalComment.vue";
import UnApprovalComment from "../components/UnApprovalComment.vue";
import UserM from "../components/UserM.vue";
import Admin from "../components/Admin.vue";
import Advice from "../components/Advice.vue";
import RemovedSale  from "../components/RemovedSale.vue";
import ProductSortM  from "../components/ProductSortM.vue";
import LoginLog  from "../components/LoginLog.vue";
//
const routes = [
    { path: '/',name:"/Login",meta:{title:"登录",power:10}, component: Login },
        {path:'/main',name:"main",meta:{title:"主界面",power:10},component:Main,children:[
            {path:'/data',name:"data",meta:{title:"数据看板",power:20},component:DataBoard},
            {path:'/user',name:"user",meta:{title:"用户管理",power:50},component:UserM},
            {path:'/admin',name:"admin",meta:{title:"管理员管理",power:50},component:Admin},
                {path:'/loginlog',name:"loginlog",meta:{title:"用户登录日志",power:50},component:LoginLog},
                {path:'/uaproduct',name:"uaproduct",meta:{title:"上架商品管理",power:60},component:UnApproval},
                {path:'/approval',name:"approval",meta:{title:"上架商品管理(已审核)",power:600},component:ApprovalProduct},
                {path:'/uashare',name:"uashare",meta:{title:"分享帖审核",power:60},component:UnApprovalShare},
            {path:'/ashare',name:"ashare",meta:{title:"分享帖审核(已审核)",power:600},component:ApprovalShare},
                {path:'/uacommment',name:"uacommment",meta:{title:"交易评论审核",power:60},component:UnApprovalComment},
            {path:'/acommment',name:"acommment",meta:{title:"交易评论审核(已审核)",power:600},component:ApprovalComment},
            {path:'/announce',name:"announce",meta:{title:"发布公告",power:70},component:Announce},
            {path:'/announceh',name:"announceh",meta:{title:"历史发布公告",power:70},component:AnnounceH},
            {path:'/appeal',name:"appeal",meta:{title:"申诉管理",power:80},component:Appeal},
            {path:'/advice',name:"advice",meta:{title:"建议管理",power:80},component:Advice},
            {path:'/productm',name:"productm",meta:{title:"在售商品",power:90},component:ProductM},
             {path:'/removedsale',name:"removedsale",meta:{title:"下架商品",power:90},component:RemovedSale},
                {path:'/productsortm',name:"productsortm",meta:{title:"类别管理",power:90},component:ProductSortM},
        ]},
]

const router = createRouter({
    history: createWebHistory(),
    routes
});

export default router;